home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 6633 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: CS.Arizona.EDU!not-for-mail
  2. From: dave@CS.Arizona.EDU (Dave Schaumann)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: GCC C++ questions
  5. Date: 31 Mar 1996 12:09:02 -0700
  6. Organization: University of Arizona CS Department, Tucson AZ
  7. Message-ID: <4jml8e$416@lectura.CS.Arizona.EDU>
  8. References: <314c6829@usura.metropolis.nl> <4ii74q$ss2@hamilton.maths.tcd.ie> <315287AB.41C67EA6@cs.bham.ac.uk>
  9. NNTP-Posting-Host: lectura.cs.arizona.edu
  10.  
  11. In article <315287AB.41C67EA6@cs.bham.ac.uk>,
  12. Derek M Avery  <D.M.Avery-CSSE94@cs.bham.ac.uk> wrote:
  13. >David Malone wrote:
  14. >> 
  15. >> joskam@usura.metropolis.nl (Jurjen Oskam) writes:
  16. >> 
  17. >> >Hello there,
  18. >> 
  19. >> >#include <iostream.h>
  20. >> 
  21. >> >int main()
  22. >> >{
  23. >> >   cout << "Hello!" << endl ;
  24. >> >}
  25. >> 
  26. >> >This compiles OK, but the executable is 69KB!
  27.  
  28.  
  29. Well, I included <stdlib.h>, so I could return EXIT_SUCCESS at the
  30. end, but I got an executable of 68172 bytes.  As others have observed,
  31. the stream library is big.  If you want a small "hello" executable,
  32. call puts() or Write() instead.  Or write in assembly language.
  33.  
  34.  
  35. >have you tried using the -O flag for compiling?
  36.  
  37. Turning on optimization isn't going to do *anything* to the size
  38. of the libraries linked in.  I just tried it, and got an executable
  39. of 68140 bytes.  That's right, you heard it here first, folks: turning
  40. on -O results in a savings of a whopping 32 bytes for this program.
  41. (Which is actually fairly impressive, considering what's available
  42. to be optimized).
  43.  
  44. -Dave
  45.